package com.gcosc.hly.codejava.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gcosc.hly.codejava.entity.TopicResult;
import com.gcosc.hly.codejava.mapper.TopicResultMapper;
import com.gcosc.hly.codejava.service.TopicResultService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class TopicResultServiceImpl extends ServiceImpl<TopicResultMapper, TopicResult> implements TopicResultService {

    @Override
    public void edit(TopicResult topicResult) {
        if (topicResult.getId() == 0){
            save(topicResult);
            return;
        }
        updateById(topicResult);
    }
}
